package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.bo.BrandListBo;
import com.cskaoyan.bean.pojo.MallBrand;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.vo.BrandListVo;
import com.cskaoyan.bean.vo.MallBrandVo;
import com.cskaoyan.service.WxBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: ycb
 * @description: 品牌页面
 * @time: 2021/7/12 14:44
 */
@RestController
@RequestMapping("wx/brand")
public class BrandController {

    @Autowired
    WxBrandService brandService;

    /**
     * @Author ycb
     * @description: 品牌列表
     * @Date 14:45 2021/7/12
     * url:http://182.92.235.201:8083/wx/brand/list?page=1&size=10
     */
    @RequestMapping("list")
    public BaseRespVo list(BrandListBo brandListBo){
        BrandListVo brandListVo = brandService.getBrandList(brandListBo);
        return BaseRespVo.ok(brandListVo);
    }

    /**
     * @Author ycb
     * @description: 品牌详情
     * @Date 15:41 2021/7/12
     * url: http://182.92.235.201:8083/wx/brand/detail?id=1046043
     */
    @RequestMapping("detail")
    public BaseRespVo detail(Integer id){
        MallBrandVo brand = brandService.getBrandDetail(id);
        return BaseRespVo.ok(brand);
    }

}